(require 'org)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)
(add-hook 'org-mode-hook 'my-org-mode-hook)
(defun my-org-mode-hook ()
  (local-set-key "\M-\C-g" 'org-plot/gnuplot))

(org-remember-insinuate)
(setq org-directory "~/org/")
(setq org-default-notes-file (concat org-directory "/notes.org"))
(define-key global-map "\C-cr" 'org-remember)

(setq org-remember-templates
      '(("Todo" ?t "* TODO %?\n  %i\n  %a" "task.org" "Tasks")
        ("Journal" ?j "* %U %?\n\n  %i\n  %a" "journal.org")
        ("Idea" ?i "* %^{Title}\n  %i\n  %a" "journal.org" "New Ideas")))
(setq org-agenda-files '("task.org"))
(setq org-confirm-shell-link-function nil)
(setq org-confirm-elisp-link-function nil)
(add-to-list 'load-path "~/.emacs.d/gnuplot")
(autoload 'gnuplot-mode "gnuplot" "gnuplot major mode" t)
(autoload 'gnuplot-make-buffer "gnuplot" "open a buffer in gnuplot mode" t)
(setq auto-mode-alist (append '(("\\.gp$" . gnuplot-mode)) auto-mode-alist))

;; allow for export=>beamer by placing
;; #+LaTeX_CLASS: beamer in org files
(unless (boundp 'org-export-latex-classes)
  (setq org-export-latex-classes nil))
(add-to-list 'org-export-latex-classes
  '("beamer"
"\\documentclass[slidestop,compress,mathserif]{beamer}
\\mode<presentation>
\\usetheme{Antibes}
\\usecolortheme{lily}
\\beamertemplateballitem
\\setbeameroption{show notes}
\\usepackage[utf8]{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage{hyperref}
\\usepackage{color}
\\usepackage{verbatim}
\\institute{ICT, DCOS.}"

     ("\\section{%s}" . "\\section*{%s}")
     ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
      "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))

;; (require 'org-babel-init)
;; (require 'org-babel-python)
;; (org-babel-load-library-of-babel)

(provide 'my-org)
